<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

namespace app\admin\model;
use think\Model;
/**
 * Description of Usertask
 *
 * @author Administrator
 */
class Usertask extends Model
{
    //put your code here
    
    protected $append = [
        'expenditure',
    ];
       public function getExpenditureAttr($value, $data) {
        return $data['commission'] +$data['onefee']+$data['twofee'];
    }
     public function task()
    {
          
          //return $this->hasOne('Task','task_id');
        return $this->belongsTo('Task', 'task_id')->setEagerlyType(0);
    }
}
